<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>From Js</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="http://www.chendd.cn/app/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="../../font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="../../bootstrap.min.css" />
<link rel="stylesheet" href="../dist/bootstrap-table.css" />
<script type="text/javascript" src="../../jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../popper.min.js"></script>
<script type="text/javascript" src="../../bootstrap.min.js"></script>
<script type="text/javascript" src="../dist/bootstrap-table.min.js"></script>
</head>
<body>

<div id="array-toolbar">数组对象数据渲染</div>
<table id="array-table"></table>

<div id="toolbar">
    <button class="btn btn-primary"><i class="fa fa-plus fa-1"></i>&nbsp;新增</button>
    <button class="btn btn-info"><i class="fa fa-edit fa-1"></i>&nbsp;修改</button>
    <button class="btn btn-danger"><i class="fa fa-times fa-1"></i>&nbsp;删除</button>
</div>
<table id="data-table"></table>

<script type="text/javascript">
$("#array-table").bootstrapTable({
    showColumns: true,
    showRefresh: true,//示例中缺少该属性对应的图标,
    icons: {
        refresh: "fa-refresh",
        toggleOff: 'fa-toggle-off',
        toggleOn: 'fa-toggle-on',
        columns: 'fa-th-list',
        fullscreen: 'fa-arrows-alt'
    },
    showToggle: true,
    showFullscreen: true,
    clickToSelect: true,
    toolbar: "#array-toolbar",
    data: [
        {"a":"aaa1" , "b" : "bbb1" , "c" : "ccc1" , "d" : "ddd1"},
        {"a":"aaa2" , "b" : "bbb2" , "c" : "ccc2" , "d" : "ddd2"},
        {"a":"aaa3" , "b" : "bbb3" , "c" : "ccc3" , "d" : "ddd3"}
    ],
    columns: [
        {radio: true},
        {field: "a" , title: "A"},
        {field: "b" , title: "B"},
        {field: "c" , title: "C"},
        {field: "d" , title: "D"}
    ]
});

$("#data-table").bootstrapTable({
    showColumns: true,
    showRefresh: true,//示例中缺少该属性对应的图标,
    icons: {
        refresh: "fa-refresh",
        toggleOff: 'fa-toggle-off',
        toggleOn: 'fa-toggle-on',
        columns: 'fa-th-list',
        fullscreen: 'fa-arrows-alt'
    },
    showToggle: true,
    showFullscreen: true,
    clickToSelect: true,
    toolbar: "#toolbar",
    url: "list.json",
    columns: [
        {radio: true},
        {field: "force" , title: "势力" , align: "center", sortable: true},
        {field: "magatama" , title: "勾玉" , align: "center", sortable: true},
        {field: "name" , title: "姓名" , sortable: true},
        {field: "sex" , title: "性别" , align: "center" , sortable: true},
        {field: "designation" , title: "称号"},
        {field: "description" , title: "称号描述"}
    ]
});
</script>
</body>
</html>